// TypeScript file
module Fighter {

    /**
     * 获胜Ui——郭启航
     */
    export class WinUI extends eui.Component {
        public Tips: eui.Label;
        constructor() {
            super();
            this.skinName = "resource/assets/PlaneE/Win.exml";
            this.addEventListener(egret.Event.ADDED_TO_STAGE, this.AddToStage, this);
        }
        /**胜利返回按钮*/
        public Win_BackPage: eui.Image;
        /**重新开始 */
        public is_restart: boolean = false;
        public AddToStage() {
            this.Tips.visible = false;
            this.Win_BackPage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.Close, this);
        }

        public Close(evt: egret.TouchEvent) {
            if (GameUtil.PlayerMessage.instance.onePerson == false && Fighter.OlUI.OlUI_solo.is_match == false) {
                this.Win_BackPage.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.Close, this);
            }
            GameUtil.PlayerMessage.instance.isGameOver = true;
            GameUtil.PlayerMessage.instance.isBuyAroundPlane = false;
            GameUtil.PlayerMessage.instance.isBuyFollowPlane = false;
            this.is_restart = true;
        }
    }
}